//
//  UIView+WJ.m
//  BeDeJie
//
//  Created by jerry on 2017/1/28.
//  Copyright © 2017年 jerry. All rights reserved.
//

#import "UIView+WJ.h"

@implementation UIView (WJ)

- (void)setWj_height:(CGFloat)wj_height{
    CGRect rect = self.frame;
    rect.size.height = wj_height;
    self.frame = rect;
}

- (CGFloat)wj_height{
    return self.frame.size.height;
}

- (CGFloat)wj_width{
    return self.frame.size.width;
}
- (void)setWj_width:(CGFloat)wj_width{
    CGRect rect = self.frame;
    rect.size.width = wj_width;
    self.frame = rect;
}

- (CGFloat)wj_x{
    return self.frame.origin.x;
}
- (void)setWj_x:(CGFloat)wj_x{
    CGRect rect = self.frame;
    rect.origin.x = wj_x;
    self.frame = rect;
}

- (void)setWj_y:(CGFloat)wj_y{
    CGRect rect = self.frame;
    rect.origin.y = wj_y;
    self.frame = rect;
}
- (CGFloat)wj_y{
    
    return self.frame.origin.y;
}

- (void)setWj_centerX:(CGFloat)wj_centerX
{
    CGPoint center = self.center;
    center.x = wj_centerX;
    self.center = center;
}

- (CGFloat)wj_centerX
{
    return self.center.x;
}

- (void)setWj_centerY:(CGFloat)wj_centerY
{
    CGPoint center = self.center;
    center.y = wj_centerY;
    self.center = center;
}

- (CGFloat)wj_centerY
{
    return self.center.y;
}

+ (instancetype) viewFromXib{
    return [[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil].firstObject;
}



@end
